package goover.unit03;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class StreamDemo02 {
    public static void main(String[] args){
        Stream<String> stream = Stream.of("张三","张飞","小五","小六","张小飞");
//        stream.forEach(i -> System.out.print(i + " "));
//        stream.filter(i -> i.startsWith("张")).filter(i -> i.length() > 2).forEach(i -> System.out.println(i));
//        stream.filter(i -> i.startsWith("张") && i.length() > 2).forEach(i -> System.out.println(i));
//        List<String> list = stream.filter(i -> i.startsWith("张")).collect(Collectors.toList());
//        System.out.println(list);
        Stream<String> stream1 = stream.parallel();
        System.out.println(stream1.isParallel());
    }
}
